import React from "react";
import { AtModal } from "taro-ui";
import "./index.scss";
import "taro-ui/dist/style/components/modal.scss";
import { DialogProps } from "../../../types/components/dialog";

/**
 * Dialog
 */
const Dialog: React.FC<DialogProps> = ({
  isOpened = false,
  title,
  content,
  cancelText = "取消",
  confirmText = "确定",
  onClose,
  onConfirm
}) => {
  return (
    <AtModal
      isOpened={isOpened}
      title={title}
      content={content}
      cancelText={cancelText}
      confirmText={confirmText}
      onClose={onClose}
      onCancel={onClose}
      onConfirm={onConfirm}
    />
  );
};

export default Dialog;
